package com.he.DesignPatterns.decorator.demo3_adater;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/8/27 14:49
 */
public class Client {

    public static void main(String[] args) {
        System.out.println("=============原来的接口调用");
        QueryInterface queryInterface = new QueryInterfaceImpl();
        queryInterface.queryData();
        System.out.println("=============添加新的方法，实现了新增接口，接口调用变了");
        AdapterClass adapterClass = new AdapterClass(queryInterface);
        adapterClass.queryData();
        adapterClass.updateData();

        System.out.println("=============增强了原来的方法，代理模式的接口调用不变");
        ProxyClass proxyClass = new ProxyClass();
        QueryInterface queryInterface1 = proxyClass.getQueryInterface();
        queryInterface1.queryData();
    }
}
